package yf.mall.entity;


import com.yf.entity.Tree;
import lombok.Setter;
import lombok.Getter;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;


/**
 * 分类实体
 * 表名 mall_type
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date Fri Nov 01 11:21:43 CST 2019
 */
@Setter
@Getter
public class MallTypeEntity  implements Serializable {
    private static final long serialVersionUID = 1L;

    //
    private Long id;
    //名称
    private String name;
    //ENUM-类型:"ONE-一级","TWO-二级"
    private Integer type;
    //IMG-图片
    private String img;
    //排序
    private Integer sort;
    //上级ID
    private Long pid;

    public MallTypeEntity(){

    }

    //自定义

        private List<MallTypeEntity> children;

    public void addChildren(MallTypeEntity mallTypeEntity){
        if (children == null){
            children = new ArrayList<>();
        }
        children.add(mallTypeEntity);
    }

}
